package com.sebiotec.book.adapt;

import android.view.View;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.sebiotec.basecommon.utils.tools.TimeUtil;
import com.sebiotec.book.R;
import com.sebiotec.book.model.response.MessageDetailResponse;

import java.util.List;

public class MsgAdapt extends BaseQuickAdapter< MessageDetailResponse.EventsBean, BaseViewHolder> {

    public MsgAdapt(int layoutResId, @Nullable List<MessageDetailResponse.EventsBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, MessageDetailResponse.EventsBean item) {
        helper.setText(R.id.tv_green,item.getCreateUser());
        helper.setText(R.id.tv_message_detail_time, TimeUtil.getFormatData_O(item.getCreateDate()));

        switch (item.getBKStatus()) {
            //1:Ambassador pickup 2:Driver pickup 3: Completed(Driver pickdown) 4:Rejected
            case 1:
                helper.setText(R.id.tv_name,getContext().getString(R.string.adapt_confirmed_bys));
                break;
            case 2:
                helper.setText(R.id.tv_name, getContext().getString(R.string.greeted_bys));
                break;
            case 3:
                helper.setText(R.id.tv_name, getContext().getString(R.string.Picked_up_bys));
                break;
            case 4:
                helper.setText(R.id.tv_name, getContext().getString(R.string.droped_off_bys));
                break;
            case 5:
                helper.setText(R.id.tv_name, getContext().getString(R.string.completed_bys));
                break;

            case 7:
                helper.setText(R.id.tv_name, getContext().getString(R.string.dispatched_bys));
                break;

            case 0:
                helper.setText(R.id.tv_name, getContext().getString(R.string.created_bys));
                break;
            case -1:
                helper.setText(R.id.tv_name, getContext().getString(R.string.rejected_bys));
                break;
            case -2:
                helper.setText(R.id.tv_name, getContext().getString(R.string.cancelled_bys));
                break;
            case 9:
                helper.setText(R.id.tv_name, getContext().getString(R.string.no_show));
                break;
            case 13:
                helper.setText(R.id.tv_name, getContext().getString(R.string.updated));
                break;
            default:
                helper.itemView.findViewById(R.id.ll_dx).setVisibility(View.GONE);
                break;
        }





    }
}